package com.jf.spring.factory;

import com.jf.spring.bean.Student;

import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-10-22
 * Time:12:32
 */
public class StaticFactory {
    private static Map<String, Student> students = new HashMap<String, Student>();
    static {
        students.put("s1", new Student(1));
        students.put("s2", new Student(2));
        students.put("s3", new Student(3));
    }
    public static Student getStudent(String key) {
        return students.get(key);
    }
}
